﻿<UserControl x:Class="Framework.UI.TestHarness.Views.FlipControlView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:collections="clr-namespace:System.Collections;assembly=mscorlib"
             xmlns:params="http://schemas.codeplex.com/elysium/params"
             xmlns:extra="http://schemas.extra.com/ui"
             xmlns:system="clr-namespace:System;assembly=mscorlib"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>


        <TextBlock Grid.ColumnSpan="2" 
                   Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                   Style="{StaticResource HeaderTextStyle}" 
                   Text="FlipControl"/>
        <TextBlock Grid.ColumnSpan="2" 
                   Grid.Row="1"
                   Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Right, Bottom', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"
                   Style="{StaticResource NormalTextStyle}"
                   Text="A control used to show a changing number or collection."/>

        <Label Grid.Row="2" 
               Content="Integer"
               Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Bottom', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"
               Target="{Binding ElementName=IntegerIntegerUpDown}"/>
        <extra:IntegerUpDown x:Name="IntegerIntegerUpDown" 
                             Grid.Column="1"
                             Grid.Row="2"
                             HorizontalAlignment="Left"
                             Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                             Value="1"
                             Width="100"/>

        <Label Grid.Row="3" 
               Content="FlipControl (Header)"
               Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Bottom', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"/>
        <extra:FlipControl Grid.Column="1" 
                           Grid.Row="3"
                           Integer="{Binding ElementName=IntegerIntegerUpDown, Path=Value}"
                           Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"/>

        <Label Grid.Row="4" 
               Content="FlipControl (Normal)"
               Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Bottom', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"/>
        <extra:FlipControl Grid.Column="1" 
                           Grid.Row="4"
                           Integer="{Binding ElementName=IntegerIntegerUpDown, Path=Value}"
                           Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                           Style="{StaticResource NormalTextFlipControl}"/>

        <Label Grid.Row="5" 
               Content="FlipControl (Accent)"
               Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Bottom', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"/>
        <extra:FlipControl Grid.Column="1" 
                           Grid.Row="5"
                           Integer="{Binding ElementName=IntegerIntegerUpDown, Path=Value}"
                           Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                           Style="{StaticResource AccentTextFlipControl}"/>

        <Label Grid.Row="6" 
               Content="FlipControl (Bold)"
               Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Bottom', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"/>
        <extra:FlipControl Grid.Column="1" 
                           Grid.Row="6"
                           Integer="{Binding ElementName=IntegerIntegerUpDown, Path=Value}"
                           Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                           Style="{StaticResource BoldTextFlipControl}"/>

        <Label Grid.Row="7" 
               Content="FlipControl (Fade)"
               Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Bottom', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"/>
        <extra:FlipControl Grid.Column="1" 
                           Grid.Row="7"
                           Integer="{Binding ElementName=IntegerIntegerUpDown, Path=Value}"
                           Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                           Style="{StaticResource FadeFlipControl}"/>

        <Label Grid.Row="8" 
               Content="FlipControl (LargeFade)"
               Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Bottom', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"/>
        <extra:FlipControl Grid.Column="1" 
                           Grid.Row="8"
                           Integer="{Binding ElementName=IntegerIntegerUpDown, Path=Value}"
                           Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                           Style="{StaticResource LargeFadeFlipControl}"/>

        <Label Grid.Row="9" 
               Content="Colours"
               Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Bottom', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"
               Target="{Binding ElementName=ColoursItemsControl}"/>
        <ListBox x:Name="ColoursItemsControl" 
                 Grid.Column="1"
                 Grid.Row="9"
                 Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}">
            <ListBox.ItemsSource>
                <collections:ArrayList>
                    <system:String>Red</system:String>
                    <system:String>Yellow</system:String>
                    <system:String>Blue</system:String>
                    <system:String>Green</system:String>
                    <system:String>Purple</system:String>
                </collections:ArrayList>
            </ListBox.ItemsSource>
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding}"
                               VerticalAlignment="Center"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

        <Label Grid.Row="10" 
               Content="FlipControl (Header)"
               Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Bottom', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"/>
        <extra:FlipControl Grid.Column="1" 
                           Grid.Row="10"
                           HorizontalAlignment="Left"
                           ItemsSource="{Binding ElementName=ColoursItemsControl, Path=ItemsSource}"
                           Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                           SelectedItem="{Binding ElementName=ColoursItemsControl, Path=SelectedItem}">
            <extra:FlipControl.ItemTemplate>
                <DataTemplate>
                    <Rectangle Fill="{Binding}"
                               Height="50"
                               Width="50"/>
                </DataTemplate>
            </extra:FlipControl.ItemTemplate>
        </extra:FlipControl>

    </Grid>
</UserControl>
